1. Field of the Invention
The present invention relates to digital image and video processing. More specifically, the present invention relates to methods of noise reduction for digital images of a digital video stream.
2. Discussion of Related Art
Due to advancing semiconductor processing technology, integrated circuits (ICs) have greatly increased in functionality and complexity. With increasing processing and memory capabilities, many formerly analog tasks are being performed digitally. For example, images, audio and even full motion video can now be produced, distributed, and used in digital formats.
FIG. 1(a) is illustrative diagram of a digital video stream 100. Digital video stream 100 comprises a series of individual digital images 100_0 to 100_N, each digital image of a video stream is often called a frame. For full motion video a video frame rate of 60 images per second is desired. As illustrated in FIG. 1(b), a digital image 100_Z comprises a plurality of picture elements (pixels). Specifically, digital image 100_Z comprises Y rows of X pixels. For clarity, pixels in an digital image are identified using a two-dimensional coordinate system. As shown in FIG. 1(b), pixel P(0, 0) is in the top left corner of digital image 200. Pixel P(Xxe2x88x921, 0) is in the top right corner of digital image 100_Z. Pixel P(0, Yxe2x88x921) is in the bottom left corner and pixel P(Xxe2x88x921, Yxe2x88x921) is in the bottom right corner. Typical image sizes for digital video streams include 640xc3x97480, 320xc3x97240 and 160 by 120.
Although digital images generally provide higher noise immunity, most digital images in digital video streams are converted from analog video streams. The original analog video stream may contain noise from various sources. For example, if the analog video is transferred over transmission lines, magnetic fields around the transmission line may add gaussian noise. In addition, salt and pepper noise (i.e., bright spots on a dark background or dark spots on a white background) may be caused by interference from other electromagnetic fields. Furthermore, the digitalizing process may inadvertently amplify minor noise problems in the analog video stream. Hence, there is a need for a noise filtering method or system to reduce noise in a digital image. Furthermore, noise filtering in a digital video stream must be performed quickly to match the frame rate of the digital video stream.
Accordingly, the present invention provides a method and system for tagging pixels exhibiting a first noise type, such as salt and pepper noise and then performing a second filtering process to reduce other noise types, such as gaussian noise. By tagging pixels with the first noise type, the second filtering process is not degraded by the first noise type.
In one embodiment of the present invention, the pixels of a first filter mask are separated into a plurality of groups based on luminance. The group boundaries are determined by dividing the luminance range of the pixels into equal sized groups. Each group is assigned a group number starting with the number one. The largest group, i.e., the group with the most pixels, is determined. Groups of pixels that are small and far from the largest group are tagged as noisy.
To determine if a group is small compared to the largest group, a group size of the group is calculated. Then a group size ratio for the group is calculated by dividing the group size with the size of the largest group IF the group size ratio is smaller than a group size threshold the group is considered small. To determine if a group is far from the largest group, a group distance from the largest group is determined based on the difference in the group numbers of the group and the largest group. If the group distance is greater than a group distance threshold the group is considered far from the largest group.
After tagging groups of pixels as noisy, a second filtering process can be performed on the pixels of the first filter mask. For example, in one embodiment of the present invention gaussian noise is detected and eliminated in the second filtering process. Specifically, edge detection is performed on a second filter mask that contains a subset of the pixels of the first filter mask. If an edge is detected in the second filter mask and the center pixel is tagged as noisy, then the value of the center pixel is replaced by a median value of the pixels of the first filter mask.
If no edge is detected in the second filter mask, edge detection is performed in the first filter mask. If an edge is detected in the first filter mask, the value of the center pixel is replaced with the mean value of the pixels in the second filter mask. Otherwise, the center value is replaced with the mean value of the pixels in the first filter mask.
The present invention will be more fully understood in view of the following description and drawings.